<template>
  <section class="shenghuohuiEdit">
    <el-dialog :title="dialogtitle" :visible.sync="dialogVisible" width="98%" top="20px" :close-on-click-modal="false" :close-on-press-escape="false" append-to-body>
      <el-form v-if="!infoLoading" ref="postForm" :model="postForm" :rules="rules" class="form-container">
        <div id="shenghuohuiEditTable">
          <h1 style="margin:0 20px 20px;">合并一稿通报情况</h1>
          <table cellspacing="0" cellpadding="0" class="mytable" style="margin:0 20px;">
            <tr>
              <th width="100px">通报稿</th>
              <td>
                <el-form-item prop="upload1">
                  <el-upload
                    style="width:800px"
                    ref="upload1"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.shenghuohuiAPI +'api/newFileInfo/upload/'"
                    :on-success="(response, file, fileList)=>{ return handleUploadSucc(response, file, fileList,1)}"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="true"
                    :file-list="fileListEdit1"
                    :before-upload="beforeUpload"
                    accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-works,.wps"
                  >
                    <el-button type="primary">上传</el-button>
                    <div slot="tip" class="el-upload__tip">注：支持上传word/pdf/wps文件。可单独通报，分别上传有关通报稿；也可合并通报有关情况，上传一次有关通报稿</div>
                    <div style="clear:both" />
                  </el-upload>
                </el-form-item>
              </td>
            </tr>
          </table>
          <el-divider id="shenghuohuiline" content-position="left">或</el-divider>
          <h1 style="margin:20px;">通报上年度民主生活会整改措施落实情况</h1>
          <table cellspacing="0" cellpadding="0" class="mytable" style="margin:0 20px;">
            <tr>
              <th width="100px">通报稿</th>
              <td>
                <el-form-item prop="upload2">
                  <el-upload
                    style="width:800px"
                    ref="upload2"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.shenghuohuiAPI +'api/newFileInfo/upload/'"
                    :on-success="(response, file, fileList)=>{ return handleUploadSucc(response, file, fileList,2)}"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="true"
                    :file-list="fileListEdit2"
                    :before-upload="beforeUpload"
                    accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-works,.wps"
                  >
                    <el-button type="primary">上传</el-button>
                    <div slot="tip" class="el-upload__tip">注：支持上传word/pdf/wps文件</div>
                  </el-upload>
                </el-form-item>
              </td>
            </tr>
          </table>
          <h1 style="margin:20px;">通报巡视整改专题民主生活会整改措施落实情况</h1>
          <table cellspacing="0" cellpadding="0" class="mytable" style="margin:0 20px;">
            <tr>
              <th width="100px">通报稿</th>
              <td>
                <el-form-item prop="upload3">
                  <el-checkbox v-model="postForm.weixunshi" label="未接受巡视" :value="1" />
                  <el-upload
                    style="width:800px"
                    ref="upload3"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.shenghuohuiAPI +'api/newFileInfo/upload/'"
                    :on-success="(response, file, fileList)=>{ return handleUploadSucc(response, file, fileList,3)}"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="true"
                    :file-list="fileListEdit3"
                    :before-upload="beforeUpload"
                    accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-works,.wps"
                  >
                    <el-button type="primary">上传</el-button>
                    <div slot="tip" class="el-upload__tip">注：支持上传word/pdf/wps文件</div>
                  </el-upload>
                </el-form-item>
              </td>
            </tr>
          </table>
          <!-- <h1>通报“灯下黑”问题专项整治整改措施落实情况</h1>
          <table cellspacing="0" cellpadding="0" class="mytable">
            <tr>
              <th width="100px">通报稿</th>
              <td>
                <el-form-item prop="upload4">
                  <el-upload
                    style="width:800px"
                    ref="upload4"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.shenghuohuiAPI +'api/newFileInfo/upload/'"
                    :on-success="(response, file, fileList)=>{ return handleUploadSucc(response, file, fileList,4)}"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="true"
                    :file-list="fileListEdit4"
                    :before-upload="beforeUpload"
                    accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-works,.wps"
                  >
                    <el-button type="primary">上传</el-button>
                    <div slot="tip" class="el-upload__tip">注：支持上传word/pdf/wps文件</div>
                  </el-upload>
                </el-form-item>
              </td>
            </tr>
          </table> -->
          <h1 style="margin:20px;">通报本次民主生活会征求意见情况</h1>
          <table cellspacing="0" cellpadding="0" class="mytable" style="margin:0 20px 20px;">
            <tr>
              <th width="100px">通报稿</th>
              <td>
                <el-form-item prop="upload5">
                  <el-upload
                    style="width:800px"
                    ref="upload5"
                    :action="this.$http.defaults.baseURL+this.$http.defaults.shenghuohuiAPI +'api/newFileInfo/upload/'"
                    :on-success="(response, file, fileList)=>{ return handleUploadSucc(response, file, fileList,5)}"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :on-error="uploadError"
                    :multiple="true"
                    :file-list="fileListEdit5"
                    :before-upload="beforeUpload"
                    accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-works,.wps"
                  >
                    <el-button type="primary">上传</el-button>
                    <div slot="tip" class="el-upload__tip">注：支持上传word/pdf/wps文件</div>
                  </el-upload>
                </el-form-item>
              </td>
            </tr>
          </table>
          <el-button type="primary" :loading="loading" @click="submitForm" style="margin:0 20px 10px;">保存</el-button>
        </div>
      </el-form>
    </el-dialog>
    <div v-if="listLoading" style="margin:20px;">正在加载...</div>
    <div v-else style="margin:10px" id="shenghuohuiEditTable">
      <div style="font-weight:bolder;padding:0 20px 20px 0;">通报有关整改措施落实情况和征求意见情况</div>
      <div v-if="tableData&&tableData.length>0">
        <div style="width:98%;margin:0 auto">
        <h1>合并一稿通报情况</h1>
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th width="100px">通报稿</th>
            <td>
              <div v-for="(item,index) in fileList1" :key="'file1_'+index">
                <a :href="$http.defaults.baseURL+$http.defaults.shenghuohuiAPI +'api/newFileInfo/download?download=true&id='+item.id" target="_blank">{{item.fileName}}{{item.fileType?'.'+item.fileType:''}}</a>
                 <template v-if="item.fileType==='pdf'"><i style="cursor: pointer;" class="el-icon-search" @click="download(item.id)" /></template>
              </div>
            </td>
          </tr>
        </table>
        </div>
        <el-divider id="shenghuohuiline" content-position="left">或</el-divider>
        <div style="width:98%;margin:0 auto">
        <h1>通报上年度民主生活会整改措施落实情况</h1>
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th width="100px">通报稿</th>
            <td>
              <div v-for="(item,index) in fileList2" :key="'file2_'+index">
                <a :href="$http.defaults.baseURL+$http.defaults.shenghuohuiAPI +'api/newFileInfo/download?download=true&id='+item.id" target="_blank">{{item.fileName}}{{item.fileType?'.'+item.fileType:''}}</a>
                 <template v-if="item.fileType==='pdf'"><i style="cursor: pointer;" class="el-icon-search" @click="download(item.id)" /></template>
              </div>
            </td>
          </tr>
        </table>
        <h1>通报巡视整改专题民主生活会整改措施落实情况</h1>
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th width="100px">通报稿</th>
            <td>
              <div v-if="tableData[0].weixunshi">未接受巡视</div>
              <div v-for="(item,index) in fileList3" :key="'file3_'+index">
                <a :href="$http.defaults.baseURL+$http.defaults.shenghuohuiAPI +'api/newFileInfo/download?download=true&id='+item.id" target="_blank">{{item.fileName}}{{item.fileType?'.'+item.fileType:''}}</a>
                 <template v-if="item.fileType==='pdf'"><i style="cursor: pointer;" class="el-icon-search" @click="download(item.id)" /></template>
              </div>
            </td>
          </tr>
        </table>
        <!-- <h1>通报“灯下黑”问题专项整治整改措施落实情况</h1>
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th width="100px">通报稿</th>
            <td>
              <div v-for="(item,index) in fileList4" :key="'file4_'+index">
                <a :href="$http.defaults.baseURL+$http.defaults.shenghuohuiAPI +'api/newFileInfo/download?download=true&id='+item.id" target="_blank">{{item.fileName}}{{item.fileType?'.'+item.fileType:''}}</a>
                 <template v-if="item.fileType==='pdf'"><i style="cursor: pointer;" class="el-icon-search" @click="download(item.id)" /></template>
              </div>
            </td>
          </tr>
        </table> -->
        <h1>通报本次民主生活会征求意见情况</h1>
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th width="100px">通报稿</th>
            <td>
              <div v-for="(item,index) in fileList5" :key="'file5_'+index">
                <a :href="$http.defaults.baseURL+$http.defaults.shenghuohuiAPI +'api/newFileInfo/download?download=true&id='+item.id" target="_blank">{{item.fileName}}{{item.fileType?'.'+item.fileType:''}}</a>
                 <template v-if="item.fileType==='pdf'"><i style="cursor: pointer;" class="el-icon-search" @click="download(item.id)" /></template>
              </div>
            </td>
          </tr>
        </table>
        </div>
        <el-button type="success" @click="modData(tableData[0].id)" icon="el-icon-edit">编辑</el-button>
      </div>
      <div v-else>
        <div style="margin:20px 0;">未填写</div>
        <el-button type="success" @click="addData" icon="el-icon-plus">填写</el-button>
      </div>
    </div>
  </section>
</template>
<script>
const defaultForm = {
  weixunshi: 0,
  id: null
}
export default {
  props: {
    timestamp: ''
  },
  data () {
    return {
      idNumber: '',
      personName: '',
      leaders: [],
      fileList1: [],
      fileList2: [],
      fileList3: [],
      fileList4: [],
      fileList5: [],
      fileListEdit1: [],
      fileListEdit2: [],
      fileListEdit3: [],
      fileListEdit4: [],
      fileListEdit5: [],
      files: [],
      fileList: [],
      tableName: 'newHzTongbaoqingkuang',
      dialogVisible: false,
      dialogtitle: '填写',
      infoLoading: false,
      postForm: Object.assign({}, defaultForm),
      loading: false,
      rules: {
      },
      tableHeight: 100,
      multipleSelection: [],
      btnLoading: false,
      listLoading: false,
      tableData: []
    }
  },
  watch: {
    timestamp (val) {
      this.getData()
    }
  },
  methods: {
    beforeUpload (file) {
      console.log('文件类型')
      console.log(file.name)
      const isFormat = file.name.indexOf('.docx') > 0 || file.name.indexOf('.doc') > 0 || file.name.indexOf('.pdf') > 0 || file.name.indexOf('.DOCX') > 0 || file.name.indexOf('.DOC') > 0 || file.name.indexOf('.PDF') > 0 || file.name.indexOf('.wps') > 0 || file.name.indexOf('.WPS') > 0
      const isLt500M = file.size / 1024 / 1024 < 60
      if (!isLt500M) {
        this.$message.error('单个附件不能超过60M!')
      } else {
        this.saveloading = true
      }
      if (!isFormat) {
        this.$message.error('附件格式必须为word、pdf、wps!')
      } else {
        this.saveloading = true
      }
      return isFormat && isLt500M
    },
    formatFiles (files) {
      if (files && files.length > 0) {
        const newfiles = []
        for (let i = 0; i < files.length; i++) {
          newfiles.push({ name: files[i].fileName + '.' + files[i].fileType, id: files[i].id, flag: files[i].flag })
        }
        console.log(newfiles)
        return newfiles
      }
    },
    formatSuccList (fileList) {
      if (fileList && fileList.length > 0) {
        const newfiles = []
        let i = fileList.length - 1
        if (fileList[i].response) {
          newfiles.push({ name: fileList[i].response.result[0].fileName + '.' + fileList[i].response.result[0].fileType, id: fileList[i].response.result[0].id })
        } else {
          newfiles.push(fileList[i])
        }
        console.log(newfiles)
        return newfiles
      }
    },
    removeFile (id) {
      this.files.splice(this.files.findIndex(item => item.id === id), 1)
    },
    handleUploadSucc (response, file, fileList, flag) {
      this.saveloading = false
      if (response.success) {
        this.files.push({id: response.result[0].id, fileName: response.result[0].fileName, fileType: response.result[0].fileType, fileAuth: 1, flag: flag})
        // this.fileList = this.formatSuccList(fileList)
        this.$message({
          message: '上传成功！' + response.message,
          type: 'success'
        })
        this.idNumber = null
      } else {
        this.$message({
          message: '上传失败:' + response.message,
          type: 'error'
        })
      }
    },
    beforeRemove (file, fileList) {
      if (file && file.status === 'success') {
        return this.$confirm(`确定删除 ${file.name}？`)
      }
    },
    handleRemove (file, fileList) {
      console.log('file')
      console.log(file)
      if (file && file.status === 'success') {
        let fileid = file.id ? file.id : file.response.result[0].id
        const url = 'api/newFileInfo/remove?id=' + fileid
        this.$http.get(this.$http.defaults.shenghuohuiAPI + url).then(res => {
          console.log('删除成功:', res)
          if (res.data.success === true) {
            this.files = this.files.filter(item => item.id !== fileid)
            // this.fileList = this.formatFiles(this.files)
            this.$message({
              message: '删除成功！',
              type: 'success'
            })
          }
        })
      }
    },
    uploadError (err) {
      this.saveloading = false
      console.log(err)
      this.$message({
        message: '上传失败:' + err,
        type: 'error'
      })
    },
    download (id) {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?id=' + id)
    },
    handlePreview (file) {
      if (window.navigator.msSaveOrOpenBlob) {
        navigator.msSaveBlob(this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + file.id, file.name)
      } else {
        var link = document.createElement('a')
        link.download = file.name
        link.href = this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + file.id
        link.click()
        console.log(this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + file.id)
        window.URL.revokeObjectURL(link.href)
      }
    },
    testItem (data) {
      if (data === null || data === undefined || data === '') {
        this.$message({
          message: '请将整体情况概述填写完整',
          type: 'error'
        })
        return false
      } else {
        return true
      }
    },
    submitForm () {
      this.$refs.postForm.validate((valid) => {
        if (valid) {
          this.loading = true
          let files = this.files.map(item => {
            let obj = {}
            obj = {flag: JSON.stringify({place: item.flag}), id: item.id, shenghuohuiId: localStorage.getItem('shenghuohuiId')}
            return obj
          })
          console.log(files)
          let para = {
            id: this.postForm.id,
            shenghuohuiunitId: localStorage.getItem('shenghuohuiunitId'),
            weixunshi: this.postForm.weixunshi ? 1 : 0,
            files: files
          }
          this.$http.post(this.$http.defaults.shenghuohuiAPI + `api/` + this.tableName + `/save`, para).then(response => {
            console.log(response.data.success)
            if (response.data.success === true) {
              this.$message({
                message: '保存成功',
                type: 'success'
              })
              if (this.$refs['postForm']) {
                this.$refs['postForm'].resetFields()
              }
              this.dialogVisible = false
              this.loading = false
              this.getData()
            } else {
              console.log('保存失败:' + response.data.message)
              this.$message({
                message: '保存失败:' + response.data.message,
                type: 'error'
              })
              this.loading = false
            }
          }).catch(error => {
            console.log(error)
            this.$message({
              message: '保存失败:' + error,
              type: 'error'
            })
            this.loading = false
          })
        }
      })
    },
    addData () {
      this.dialogtitle = '填写'
      this.dialogVisible = true
      this.postForm = Object.assign({}, defaultForm)
      if (this.$refs['postForm']) {
        this.$refs['postForm'].resetFields()
      }
    },
    modData (id) {
      this.id = id
      this.dialogtitle = '编辑'
      this.dialogVisible = true
      this.infoLoading = true
      this.$http
        .get(this.$http.defaults.shenghuohuiAPI + `api/` + this.tableName + `/getById?id=` + id)
        .then(response => {
          this.infoLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            this.fileListEdit1 = []
            this.fileListEdit2 = []
            this.fileListEdit3 = []
            this.fileListEdit4 = []
            this.fileListEdit5 = []
            this.files = []
            this.postForm = Object.assign({}, response.data.result)
            this.postForm.weixunshi = !!this.postForm.weixunshi
            this.postForm.fileList.forEach(item => {
              if (JSON.parse(item.flag).place === 1) {
                this.fileListEdit1.push({url: this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + item.id, name: item.fileName.trim() + '.' + item.fileType, id: item.id})
                this.files.push({id: item.id, flag: JSON.parse(item.flag).place})
              } else if (JSON.parse(item.flag).place === 2) {
                this.fileListEdit2.push({url: this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + item.id, name: item.fileName.trim() + '.' + item.fileType, id: item.id})
                this.files.push({id: item.id, flag: JSON.parse(item.flag).place})
              } else if (JSON.parse(item.flag).place === 3) {
                this.fileListEdit3.push({url: this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + item.id, name: item.fileName.trim() + '.' + item.fileType, id: item.id})
                this.files.push({id: item.id, flag: JSON.parse(item.flag).place})
              } else if (JSON.parse(item.flag).place === 4) {
                this.fileListEdit4.push({url: this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + item.id, name: item.fileName.trim() + '.' + item.fileType, id: item.id})
                this.files.push({id: item.id, flag: JSON.parse(item.flag).place})
              } else if (JSON.parse(item.flag).place === 5) {
                this.fileListEdit5.push({url: this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/newFileInfo/download?download=true&id=' + item.id, name: item.fileName.trim() + '.' + item.fileType, id: item.id})
                this.files.push({id: item.id, flag: JSON.parse(item.flag).place})
              }
            })
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.infoLoading = false
        })
    },
    getData () {
      this.listLoading = true
      let para = {
        shenghuohuiunitId: localStorage.getItem('shenghuohuiunitId'),
        pageNum: 1,
        pageSize: 2000
      }
      // var personParams = { Page: 0, Pagenum: 20, Personname: '', Unitkey: '', Sortkey: '', Isace: true, timestamp: new Date().getTime() }
      this.$http
        .post(this.$http.defaults.shenghuohuiAPI + `api/` + this.tableName + `/queryByPage`, para)
        .then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            this.tableData = response.data.result.records
            if (this.tableData && this.tableData[0]) {
              this.fileList1 = []
              this.fileList2 = []
              this.fileList3 = []
              this.fileList4 = []
              this.fileList5 = []
              this.tableData[0].fileList.forEach(item => {
                if (JSON.parse(item.flag).place === 1) {
                  this.fileList1.push({id: item.id, fileName: item.fileName, fileType: item.fileType})
                } else if (JSON.parse(item.flag).place === 2) {
                  this.fileList2.push({id: item.id, fileName: item.fileName, fileType: item.fileType})
                } else if (JSON.parse(item.flag).place === 3) {
                  this.fileList3.push({id: item.id, fileName: item.fileName, fileType: item.fileType})
                } else if (JSON.parse(item.flag).place === 4) {
                  this.fileList4.push({id: item.id, fileName: item.fileName, fileType: item.fileType})
                } else if (JSON.parse(item.flag).place === 5) {
                  this.fileList5.push({id: item.id, fileName: item.fileName, fileType: item.fileType})
                }
              })
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading = false
        })
    },
    tableresize (obj) {
      var clientHeight = 0
      if (document.body.clientHeight && document.documentElement.clientHeight) {
        clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      } else {
        clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      }
      obj.$nextTick(function () {
        obj.tableHeight = clientHeight - 200
      })
    }
  },
  mounted () {
    this.getData()
    this.tableresize(this)
    window.onresize = () => {
      // 通过捕获系统的onresize事件触发我们需要执行的事件
      this.tableresize(this)
    }
  }
}
</script>

<style>
  #shenghuohuiline .el-divider__text{
    font-size:20px;
    font-weight: bolder;
    color: blue;
  }
  #shenghuohuiline.el-divider--horizontal{
    height: 2px !important;
    background-color: #000 !important;
  }
  .shenghuohuiEdit .el-table th{
    font-weight: normal;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
  }
  .shenghuohuiEdit .el-table td, .el-table th{
    padding:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体'
  }
  #shenghuohuiEditTable .el-upload--text{
    float:left !important;
  }
  #shenghuohuiEditTable .el-upload__tip{
    float:left !important;
    margin-left:5px;
    margin-top:0 !important;
  }
  #shenghuohuiEditTable .el-upload-list--text{
    padding-top:5px;
    clear: both !important;
  }
  .el-table{
    border-top: 1px solid #95B8E7 !important;
  }
  .el-table--border th, .el-table--border td {
    border-right: 1px solid #95B8E7 !important;
  }
  .el-table th.is-leaf, .el-table td {
    border-bottom: 1px solid #95B8E7 !important;
  }
  #shenghuohuiEditTable .mytable{
    border-top: 1px solid #74A6CC;
    border-left: 1px solid #74A6CC;
    margin: 10px;
    width: calc(100% - 40px);
    font-size:var(--size14) !important;
    font-family: '宋体'
  }
  #shenghuohuiEditTable .mytable th,
  #shenghuohuiEditTable .mytable td{
    height: auto;
    padding: 10px;
    border-right: 1px solid #74A6CC;
    border-bottom: 1px solid #74A6CC;
    vertical-align:top;
    line-height: 150%;
  }
  #shenghuohuiEditTable .mytable th{
    background:#C0DCF1;
    width:150px;
    vertical-align: middle;
  }
</style>
